package a03_哈希;

/**
 * <p>
 * a07_赎金信复习4
 * </p>
 *
 * @author flyduck
 * @since 2024/12/26
 */
public class a07_赎金信复习4 {

    public static void main(String[] args) {
        System.out.println((int)'a');
        System.out.println((int)'z');
    }

    public boolean canConstruct(String ransomNote, String magazine) {
        int[] array = new int[26];
        for (char c : ransomNote.toCharArray()) {
            array[(int)c - 97]++;
        }
        for (char c : magazine.toCharArray()) {
            array[(int)c - 97]--;
        }

        for (int i : array) {
            if(i > 0){
                return false;
            }
        }

        return true;
    }
}
